package com.feifan.oa.service.impl;

import com.feifan.common.core.text.Convert;
import com.feifan.oa.domain.FlowCategoryDetail;
import com.feifan.oa.mapper.FlowCategoryDetailMapper;
import com.feifan.oa.service.IFlowCategoryDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 具体流程Service业务层处理
 * @author 非凡
 * @date 2020-07-01
 */
@Service
public class FlowCategoryDetailServiceImpl implements IFlowCategoryDetailService {
    @Autowired
    private FlowCategoryDetailMapper flowCategoryDetailMapper;

    /**
     * 查询具体流程
     * @param id 具体流程ID
     * @return 具体流程
     */
    @Override
    public FlowCategoryDetail selectFlowCategoryDetailById(Long id) {
        return flowCategoryDetailMapper.selectFlowCategoryDetailById(id);
    }

    @Override
    public List<FlowCategoryDetail> selectFlowCategoryDateilByFlowCategoryId(Long id) {
        return flowCategoryDetailMapper.selectFlowCategoryDateilByFlowCategoryId(id);
    }

    /**
     * 查询具体流程列表
     * @param flowCategoryDetail 具体流程
     * @return 具体流程
     */
    @Override
    public List<FlowCategoryDetail> selectFlowCategoryDetailList(FlowCategoryDetail flowCategoryDetail) {
        return flowCategoryDetailMapper.selectFlowCategoryDetailList(flowCategoryDetail);
    }

    /**
     * 新增具体流程
     * @param flowCategoryDetail 具体流程
     * @return 结果
     */
    @Override
    public int insertFlowCategoryDetail(FlowCategoryDetail flowCategoryDetail) {
        return flowCategoryDetailMapper.insertFlowCategoryDetail(flowCategoryDetail);
    }

    /**
     * 修改具体流程
     * @param flowCategoryDetail 具体流程
     * @return 结果
     */
    @Override
    public int updateFlowCategoryDetail(FlowCategoryDetail flowCategoryDetail) {
        return flowCategoryDetailMapper.updateFlowCategoryDetail(flowCategoryDetail);
    }

    /**
     * 删除具体流程对象
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteFlowCategoryDetailByIds(String ids) {
        return flowCategoryDetailMapper.deleteFlowCategoryDetailByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除具体流程信息
     * @param id 具体流程ID
     * @return 结果
     */
    @Override
    public int deleteFlowCategoryDetailById(Long id) {
        return flowCategoryDetailMapper.deleteFlowCategoryDetailById(id);
    }

    @Override
    public List<FlowCategoryDetail> selectFlowCategoryDetailByFcId(Long id) {
        return flowCategoryDetailMapper.selectFlowCategoryDetailByFcId(id);
    }

    @Override
    public int selectFlowCategoryDetailTierCheck(Long id, Integer days) {
        return flowCategoryDetailMapper.selectFlowCategoryDetailTierCheck(id, days);
    }
}
